package com.bomb.voice.backNet;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;

import com.bomb.voice.R;
import com.bomb.voice.net.HttpSubscriber;

import static com.bomb.voice.net.NetConfig.FY_API_VERSION;
import static com.bomb.voice.net.NetConfig.FY_APPID;
import static com.bomb.voice.net.NetConfig.FY_AU;
import static com.bomb.voice.net.NetConfig.FY_TIMEINMILLIS;

public class AddAccountActivity extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_add_account);
    }

    public void addAccountTest(View v) {

        VoiceBackLoader voiceBackLoader = new VoiceBackLoader();
        String appAccountId = "liuyu";//自己给用户取一个名字 必须保证唯一 自己服务器上用户的名字//abcdefg1
        voiceBackLoader.addAccount(FY_APPID, appAccountId, FY_TIMEINMILLIS, FY_API_VERSION, FY_AU).subscribe(new HttpSubscriber<AddAccountBean>() {
            @Override
            public void onNext(AddAccountBean addAccountBean) {
                super.onNext(addAccountBean);

            }
        });
    }

    public void queryAccountTest(View v) {
        VoiceBackLoader voiceBackLoader = new VoiceBackLoader();
        String infoType = "2";//查询信息类型：1）飞语云账户号码；2）APP账户号码；3）手机号码
        String appAccountId = "13685781019";//自己给用户取一个名字 必须保证唯一 自己服务器上用户的名字
        voiceBackLoader.getAccount(FY_APPID, infoType,appAccountId, FY_TIMEINMILLIS, FY_API_VERSION, FY_AU).subscribe(new HttpSubscriber<AddAccountBean>() {
            @Override
            public void onNext(AddAccountBean addAccountBean) {
                super.onNext(addAccountBean);
            }
        });
    }
}
